package com.hongye.app.model;

import com.jfinal.plugin.activerecord.Model;

public class BuyerAddressModel extends Model<BuyerAddressModel> {
	
	private static final long serialVersionUID = -5317310510318889388L;
	
	public static final BuyerAddressModel dao=new BuyerAddressModel();
	
	/**
	 * 得到默认地址
	 * @author liushaomin
	 * 2017年7月12日
	 * @param phone
	 * @return
	 */
	public static BuyerAddressModel getDefaultAddress(String phone){
		String sql = "select id as buyeraddressid, consignee_phone, province, city, district, address, consignee from buyer_address where user_phone = '"+ phone +"' and state=0";
		BuyerAddressModel address = BuyerAddressModel.dao.findFirst(sql);
		return address;
	}

}
